﻿Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Imports Microsoft.Practices.EnterpriseLibrary.Logging
Imports Microsoft.Practices.EnterpriseLibrary.Data

Namespace SL
    Public NotInheritable Class ExceptionLogging
        Private Sub New()
        End Sub
        ''' <summary>
        ''' 
        ''' </summary>
        ''' <param name="message"></param>
        Public Shared Sub LogWriter(message As String)
            Dim logentry As New LogEntry()
            logentry.Message = message
            logentry.Title = "Program"
            logentry.TimeStamp = DateTime.Now
            Logger.Write(logentry)
        End Sub
        ''' <summary>
        ''' 
        ''' </summary>
        ''' <param name="ex"></param>
        Public Shared Sub HandleException(ex As Exception)
            ExceptionLogging.LogWriter(ex.Message)
            ExceptionPolicy.HandleException(ex, "Exception Policy")
        End Sub
    End Class
End Namespace